package cn.xiaoxiang.org.controller;

import cn.xiaoxiang.basic.util.AjaxResult;
import cn.xiaoxiang.basic.util.PageList;
import cn.xiaoxiang.org.domain.Log;
import cn.xiaoxiang.org.query.DepartmentQuery;
import cn.xiaoxiang.org.query.DetailQuery;

import cn.xiaoxiang.org.service.LogService;
import cn.xiaoxiang.org.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/log")
public class LogController {

    @Autowired
    private LogService logService;
    @GetMapping()
    public List<Log> findAll(){
        return logService.findAll();
    }

    @GetMapping("/{id}")
    public Log findById( @PathVariable("id") Long id) {
        return logService.findById(id);

    }
    
    //分頁
    @PostMapping()
    public PageList<Log> queryByPage(@RequestBody DepartmentQuery query) {
        return logService.queryByPage(query);
    }

}
